/**
 * 20080305 1525: Eric Kao was created.
 */
package com.e885.jdbc;

/**
 * MSSQL JDBC <br>
 * Copyright: Copyright (c) 2001-2008<br>
 * Company: E885 Group
 * 
 * @author Eric.Kao(gau168.gau@msa.hinet.net)
 * @version 1.0
 */

public class MSSQLJDBC extends JDBCUtil
{
	public static String DEFAULT_IP = "127.0.0.1";

	public static int DEFAULT_PORT = 1433;

	private String ip;

	private int port;

	private String userName;

	private String password;

	private String databaseName;

	public MSSQLJDBC( String ip, int port, String userName, String password, String databaseName )
	{
		this.ip = ip;
		this.port = port;
		this.userName = userName;
		this.password = password;
		this.databaseName = databaseName;
	}

	public MSSQLJDBC( String userName, String password, String databaseName )
	{
		this( DEFAULT_IP, DEFAULT_PORT, userName, password, databaseName );
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.e885.jdbc.JDBCUtil#getDriverName()
	 */
	protected String getDriverName()
	{
		return "com.microsoft.sqlserver.jdbc.SQLServerDriver";
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.e885.jdbc.JDBCUtil#getPassword()
	 */
	protected String getPassword()
	{
		return password;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.e885.jdbc.JDBCUtil#getUrl()
	 */
	protected String getUrl()
	{
		return "jdbc:sqlserver://" + ip + ":" + port + ";database=" + databaseName;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.e885.jdbc.JDBCUtil#getUserName()
	 */
	protected String getUserName()
	{
		return userName;
	}

}
